#include<stdio.h>
int divisor(int a,int b);
int multiple(int x,int y);
int main(void)
{
	int a,b;
	scanf("%d%d",&a,&b);
	printf("%d %d",divisor(a,b),multiple(a,b));
	return 0;
}
int divisor(int a,int b)
{
	int t, r;
	if(b>a)
	{
		t=a;
		a=b;
		b=t;
	}
	while(r>0)
	{
		r=a%b;
		a=b;
		b=r;
	}
	return b;
}
int multiple(int x,int y)
{
	return(x*y/divisor(x,y));
}
